package com.chen.dal.dateobject.user;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.chen.core.dal.BaseDO;
import com.chen.enums.CommonStatus;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 用户表
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("system_users")
@EqualsAndHashCode(callSuper = true)
public class UserDO extends BaseDO {
    /**
     * 主键id
     */
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;
    /**
     * 用户名(账号登录)
     */
    @TableField(value = "username")
    private String username;
    /**
     * 密码(账号登录)
     */
    @TableField(value = "password")
    private String password;
    /**
     * 昵称
     */
    @TableField(value = "nickname")
    private String nickname;
    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;
    /**
     * 部门id
     */
    @TableField(value = "dept_id")
    private Long deptId;
    /**
     * 职位ids(可能身兼多职)
     */
    @TableField(value = "post_ids")
    private List<Long> postIds;
    /**
     * 个人邮箱
     */
    @TableField(value = "email")
    private String email;
    /**
     * 个人手机电话号码
     */
    @TableField(value = "phone")
    private String phone;
    /**
     * 性别
     */
    @TableField(value = "sex")
    private Integer sex;
    /**
     *用户头像
     */
    @TableField(value = "avatar")
    private String avatar;
    /**
     * 用户状态
     * {@link com.chen.enums.CommonStatus}
     */
    @TableField(value = "status")
    private Integer status;
    /**
     * 登录ip
     */
    @TableField(value = "login_ip")
    private String loginIp;
    /**
     * 登录时间
     */
    @TableField(value = "login_date")
    private LocalDateTime loginDate;
}
